<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.sql.*" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="dbbean" class="bean.dbbean"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" contentType="text/html; charset=utf-8">
<title>管理页面</title>
</head>
<body>
管理员：<%=session.getAttribute("admin")%>    
<%
        String name=(String)session.getAttribute("admin");
		
        if(name==null||name.equals("")){
        response.sendRedirect("adminlogin.jsp");
        }
     %> 
    <%
    String subject,note;
    Connection conn=dbbean.getConn();
	Statement stmt=conn.createStatement();
	String mysql="select * from note";
	ResultSet rs=stmt.executeQuery(mysql); 
      out.print("<center>"); 
      out.print("<table border=1>");
      out.print("<tr>");
      out.print("<td bgcolor=yellow>姓名</td>");
      out.print("<td bgcolor=yellow>主题</td>");
      out.print("<td bgcolor=yellow>内容</td>");
      out.print("<td bgcolor=yellow>删除</td>");
      while(rs.next()) 
{ 
name=rs.getString(1);  
subject=rs.getString(2);  
note=rs.getString(3); 

out.print("<tr>");
out.print("<td>"+name+"</td>"); 
out.print("<td>"+subject+"</td>"); 
out.print("<td>"+note+"</td>"); 
out.print("<td><a href='delete.jsp?subject="+subject+"'>删除</a></td>");
out.print("</tr>");
} 
out.print("</table><p>"); 
 %>

</body>
</html>